//
//  VCAssetCreatManger.h
//  VideoCollage
//
//  Created by Mac on 2018/6/25.
//  Copyright © 2018年 stoneobs.qq.com. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void(^createProgressHandle)(CGFloat persent);
typedef void(^createHandle)(bool success, NSError *  error,NSString * path,UIImage * image);
typedef void(^CompProgressBlcok)(CGFloat progress);
typedef void(^CompCompletedBlock)(BOOL success);

/************生成资源 ******************/
@interface VCAssetCreatManger : NSObject
@property(nonatomic, assign) BOOL                                     isImageToVideo;/**< 是否是图片转视频 */
+ (VCAssetCreatManger*)manger;

/**
 合成视屏 或者一张图片

 @param view view description
 @param progress progress description
 @param handle handle description
 */
- (void)cgreateAssetWithView:(VCItemView*)view progress:(createProgressHandle)progress handle:(createHandle)handle;

/**
 视频+音乐 合成视屏

 @param localVideoPath localVideoPath description
 @param path path description
 @param progress progress description
 @param handle handle description
 */
- (void)meargeAssetWithLocalVideoPath:(NSString*)localVideoPath musicPatth:(NSString*)path progress:(createProgressHandle)progress handle:(createHandle)handle;


/**
 图片合成视频，考虑到view截图的图片 合成视屏会模糊错乱，用一个默认的视频 上面放图片合成新的视频

 @param view view description
 @param image 图片
 @param progress progress description
 @param handle handle description
 */
- (void)meargeImageToVideoPathView:(VCItemView*)view image:(UIImage*)image  progress:(createProgressHandle)progress handle:(createHandle)handle;

//导出一个视频 成新的视频，考虑到iapd ios10.3 无法保存视频到相册，特定方法
- (void)exportVideoPath:(NSString*)path handle:(createHandle)handle;;

//获取最小公倍数和最大公约数
+ (int32_t)lcmWithNumber1:(int32_t)num1 Number2:(int32_t)num2;
+ (int32_t)gcdWithNumber1:(int32_t)num1 Number2:(int32_t)num2;
@end
